function [list] = get_adjlist(matrix, labels);

% ----------------------------------------------
% This function converts an adjacency matrix to
% an adjacency list with strings.
%
% USAGE:
% [list] = get_adjlist(matrix, labels)
% ----------------------------------------------

matrix_size = size(matrix)
list = {};

for i = 1:length(labels)
    rowlist = {};
    rowlist{end+1} = labels{i};
    for j = 1:matrix_size(2)
        if matrix(i,j) 
            rowlist{end+1} = labels{j};
        end
    end
    list{end+1} = rowlist;
end

% DONE